package com.whfc.mach.dto.obd;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.whfc.mach.constant.ObdMeasurement;
import lombok.Data;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Measurement;

import java.io.Serializable;
import java.time.Instant;
import java.util.Date;
import java.util.concurrent.TimeUnit;

/**
 * @author sun_guodong
 * @description OBD设备油耗
 * @date 2021-01-29
 */
@Data
@Measurement(name = ObdMeasurement.MEASUREMENT, database = ObdMeasurement.DATABASE, retentionPolicy = ObdMeasurement.RETENTION_POLICY, timeUnit = TimeUnit.SECONDS)
public class ObdDataDTO implements Serializable {
    /**
     * 硬件id
     */
    private Integer deviceId;
    /**
     * 硬件sn
     */
    private String sn;
    /**
     * 网络状态
     */
    private Integer netState;
    /**
     * 工作状态
     */
    private Integer workState;
    /**
     * 累计总工时
     */
    private Double totalWorkHours;
    /**
     * 日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date date;

    /**
     * 油耗
     */
    @Column(name = "oilWear")
    private Double oilWear;

    /**
     * 总放线里程
     */
    private Long mile;

    /**
     * 总放线里程1
     */
    @Column(name = "mile1")
    private Long mile1;

    /**
     * 总放线里程2
     */
    @Column(name = "mile2")
    private Long mile2;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;

    /**
     * 硬件时间
     */
    @Column(name = "time")
    private Instant deviceTime;

    private Double lat;

    private Double lng;

    private String location;

}
